package me.hl.common.codec;

import com.google.common.hash.Hashing;
import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.digest.DigestUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by haoliang on 2016/7/29.
 */

public class MD5Test {
    private static Logger logger = LoggerFactory.getLogger(MD5Test.class);

    @Test
    public void testMd5() {
        //common codec
        logger.info(DigestUtils.md5Hex("planck"));
        //guava
        logger.info(Hashing.md5().hashString("planck", Charsets.UTF_8).toString());
    }

}
